﻿#if NET6_0
using SuperX.DataCenterService.WebAPI;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using System;

namespace SuperX.DataCenterService.App_Start
{
    public static class ConfigureSwagger
    {
        public static void ConfigureSwaggerUp(this IServiceCollection services)
        {
            if (services == null) throw new ArgumentNullException(nameof(services));
            var ApiName = "IOTWebAPI.Core";
            //注册Swagger
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo
                {
                    Title = $"{ApiName}接口文档",
                    Version = "v1",
                    Description = $"{ApiName} HTTP API V1",
                });
                c.DocumentFilter<SwaggerCoreDocFilter>();
            });
        }
    }
}
#endif